<!DOCTYPE HTML>
<html>
<head>
<include file="Public:head" />

</head>

<body>
<include file="Public:header" />

<div class="midder">
<div class="mc">
	<h1  id="image">{$seo.title}</h1>
	<div class="cleft">

<div class="pl photitle">
        <span class="fr">&gt; <a href="{:U('space/photos/album',array('id'=>$strPhoto['albumid']))}">返回相册</a></span>
        <span class="fl">第{$strPhoto['nowPage']}张 / 共{$strPhoto['countPage']}张</span>
        <if condition="$strPhoto['nowPage'] gt 1">
        <a id="pre_photo" title="上一张" href="{$strPhoto['prevturl']}#image">上一张</a>
        	 <if condition="$strPhoto['nowPage'] lt $strPhoto['countPage']">
        		&nbsp;&nbsp;/&nbsp;&nbsp;
             </if>
        </if>
        <if condition="$strPhoto['nowPage'] lt $strPhoto['countPage']">
        <a id="next_photo" title="下一张" href="{$strPhoto['nexturl']}#image">下一张</a>
        </if>
</div>
    
<div id="link-report">
      <div style="text-align:center">
       <if condition="$strPhoto['nowPage'] lt $strPhoto['countPage']">
          <a title="点击查看下一张" href="{$strPhoto['nexturl']}#image" class="mainphoto">
              <img src="{$strPhoto['mimg']}">
          </a>
       <else/>
       		 <img src="{$strPhoto['mimg']}">  
       </if>   
      </div>
      <div class="photo_descri">
           <p class="pl" id="desc_info">
           <span>
               <if condition="$strPhoto['photodesc']">
               	{$strPhoto['photodesc']}
               <else/>
               这张照片的还没有添加任何描述...
               </if>
           </span>
           &nbsp;<if condition="$visitor['userid'] eq $strPhoto['userid']">&gt;&nbsp;<a title="编辑描述" href="javascript:;" id="edit_pinfo">编辑描述</a></if>
           </p>
           
           <if condition="$visitor['userid'] eq $strPhoto['userid']">
           <p class="pl" id="desc_edit" style="display:none">
               <textarea maxlength="120" name="photodesc" id="photodesc" style="width:100%; margin-bottom:5px; color:#666" class="txt">{$strPhoto['photodesc']}</textarea>
               <br/>
               <input type="button" value="保存" class="subab" id="savebtn">&nbsp;&nbsp;<a href="javascript:;" id="cancle_edit">取消</a>
           </p>
           </if>
           
      </div>
      <div class="report-link" style="color:#999;margin-bottom:5px">
      		<if condition="$visitor['userid'] eq $strPhoto['userid']"><span class="fr">&gt;&nbsp;<a title="删除这张照片" href="{:U('space/photos/delphoto',array('id'=>$strPhoto['photoid']))}">删除照片</a></span></if>
            {$strPhoto['count_view']}人浏览&#12288;上传于{$strPhoto['addtime']|date="Y-m-d",###}&#12288;<a target="_blank" title="查看原图" href="{$strPhoto['img']}">查看原图</a>
      </div>
    
</div>

<div class="mod">
	<include file="./Apps/Home/View/Public/comment.html" />
</div>
    
<script language="javascript">
	$('#edit_pinfo').bind('click',function(){
		var desc_info = $('#desc_info'),desc_edit = $('#desc_edit');
		desc_info.hide();desc_edit.show();
	});
	$('#cancle_edit').bind('click',function(){
		var desc_info = $('#desc_info'),desc_edit = $('#desc_edit');
		desc_info.show();desc_edit.hide();
	});
	$('#savebtn').bind('click',function(){
		var info = $('#photodesc'),pid = {$strPhoto["photoid"]},ajaxurl='{:U("space/photos/editphoto")}';
		var desc_info = $('#desc_info'),desc_edit = $('#desc_edit');
		if(info.val()=="" || info.val() == 0){
			tips('描述不能为空字符')
		}else{
			$.post(ajaxurl,{photoid:pid,photodesc:info.val()},function(res){
				if(res.r==1){
					desc_info.show();desc_edit.hide();
					desc_info.find('span').html(res.html);
					info.val(res.html);
				}else{
					tips(res.error)
				}
			});
		}
	})
</script>    
    	
    </div><!--//cleft-->
    <div class="cright">
       
<div class="mod">
        
    <h2>
        我的相册&nbsp;·&nbsp;·&nbsp;·&nbsp;·&nbsp;·&nbsp;·
        <span class="pl">&nbsp;(<a href="{:U('space/photos/index',array('id'=>$strPhoto['userid']))}">全部</a>) </span>
    </h2>

        <div class="bd">
            <ul class="album-list">
                    <foreach name="arrAlbum" item="item">
                    <li>
                    <div class="pic">
                        <a href="{:U('space/photos/album',array('id'=>$item['albumid']))}">
                            <img width="75" height="75" alt="美女图片" src="{$item['simg']}">
                        </a>
                    </div>
                    <div class="info">
                        <a href="{:U('space/photos/album',array('id'=>$item['albumid']))}">{$item['albumname']}</a>
                        <span class="num">{$item['count_photo']}张照片</span>
                        <p><php> echo getsubstrutf8(clearText($item['albumdesc']),0,30);</php></p>
                    </div>
                    </li>
  					</foreach>				    
            </ul>
        </div>
    </div>		
        
    </div><!--//right-->
</div>
</div>

<include file="Public:footer" />
</body>
</html>